class_name ConsumeAllManaEffect
extends Effect

func execute(targets: Array[Node]) -> void:
	print("💙 ConsumeAllManaEffect.execute() 被调用")
	
	for target in targets:
		if not target or not is_instance_valid(target):
			continue
		if target is Player:
			_consume_all_mana(target)
		else:
			print("❌ 目标不是Player类型: %s" % target.get_class())

func _consume_all_mana(player: Player) -> void:
	# 获取当前能量值
	var current_mana = player.stats.mana
	print("💙 玩家当前能量: %d" % current_mana)
	
	# 将能量设置为0（消耗所有能量）
	player.stats.mana = 0
	print("💙 已消耗所有能量，当前能量: %d" % player.stats.mana) 
